<?php

namespace app\index\controller;

use app\BaseController;
use think\facade\Env;
use think\response\Redirect;

class Test extends BaseController {
    /**
     * @return Redirect
     */
    public function index() {
        echo 'login';exit;
    }

    /**
     * @return Redirect
     */
    public function test() {
        return view('index/test');
    }

    /**
     * @return Redirect
     */
    public function testJump() {
        return redirect(__url('login/index'));
    }

	/*
	http://www2.dancephp.com/index/test/testAuthcode
	*/
    public function testAuthcode() {
	    echo '测试authcodeStr加解密';
	    $str = '123456测试中文';
	    echo '<br>原始：'.$str;
	    $authcodeStr = _authcode($str, 'ENCODE');
	    echo '<br>加密：'.$authcodeStr;
	    $authcodeStr2 = _authcode($authcodeStr, 'DECODE');
	    echo '<br>解密：'.$authcodeStr2;
    }
    
    /**
	http://www2.dancephp.com/index/test/testTemplate
     */
    public function testTemplate() {
        $this->assign('name', 'ThinkPHP');
        return $this->fetch();
    }
    
    /**
	http://www2.dancephp.com/index/test/testLogin
     */
    public function testLogin() {
        $this->assign('name', 'ThinkPHP');
        return $this->fetch();
    }
    
}